public class Company {
    //公司名称，注册地址，电话，经营范围
    String companyName, address, phoneNumber, manage;
    String[] people = new String[10];

    public void companyInformation() {
        System.out.println("公司信息如下：");
        System.out.println("公司名称：" + companyName + " 注册地址：" + address + " 电话：" + phoneNumber + " 经营范围：" + manage);
    }

    public void add(String name) {
        for (int i = 0; i < people.length; i++) {
            if (people[i] == null) {
                break;
            }
        }
        for (int i = 0; i < people.length; i++) {
            if (people[i] == null) {
                people[i] = name;
                return;
            }
        }
    }

    public void information() {
        for (int j = 0; j < people.length; j++) {
            System.out.print(people[j] + " ");
        }
    }
}
//2：公司有公司名称，注册地址，电话，经营范围等属性，公司有很多员工（暂用String数组表示），
// 公司有招聘员工方法，有输出员工信息方法，以及辞退员工方法(*选做)。用oo的思想模拟
public class Oopzy02 {
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        Company co = new Company();
        co.companyName = "第一科技公司";
        co.address = "地球";
        co.phoneNumber = "0123-4567";
        co.manage = "科技";
        co.people[0] = "CEO";
        co.people[1] = "CFO";
        co.people[2] = "COO";
        co.companyInformation();
        int choice = 0;
        while (true) {
            System.out.println("\n1:招聘新人,2:查看信息，3:辞退员工，4：退出");
            choice = in.nextInt();
            if (choice == 1) {
                System.out.print("请输入新人的姓名：");
                String name = in.next();
                co.add(name);
            } else if (choice == 2) {
                co.information();
            } else if (choice == 4) {
                break;
            }
        }
    }
}